package com.zk.ppa.service.impl;

import com.zk.ppa.dao.po.Train;
import com.zk.ppa.dao.repository.TrainRepository;
import com.zk.ppa.service.TrainService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class TrainServiceImpl implements TrainService {
    @Autowired
    private TrainRepository trainRepository;


    @Override
    public Boolean saveTrain(Train train) {
        return trainRepository.save(train);
    }

    @Override
    public Boolean updateTrainById(Train train) {
        return trainRepository.updateById(train);
    }

    @Override
    public Boolean deleteTrainById(Long id) {
        return trainRepository.removeById(id);
    }

    @Override
    public Boolean deleteBatchTrainByIds(List<Long> ids) {
        return trainRepository.removeByIds(ids);
    }
}
